function tab() {
    var oli = document.querySelectorAll(".list li")
    var otab = document.querySelectorAll(".date-box, .date-box2 ,.date-box3")
    var xian = document.querySelector(".xian")
    oli.forEach((time, index) => {
        // console.log(otab[index]);
        time.index = index
        time.onclick = function () {
            clean()
            otab[time.index].style.display = "block"
            var sum = time.index * 100 + 5
            xian.style.left = sum + "px"
        }
    });

    function clean() {
        otab.forEach(element => {
            element.style.display = "none"

        })
    }
}


tab()



function admin() {
    var ouesr_state = document.querySelector(".uesr_state")
    var oadmin = document.querySelector(".admin")
    oadmin.onclick = function () {
        if(ouesr_state.style.height=="0px"){
            ouesr_state.style.border = "1px solid #dcdfe6"
            ouesr_state.style.height = 280 + "px"
        }else{
            ouesr_state.style.border = "0px solid #dcdfe6"
            ouesr_state.style.height = 0 + "px"
        }
      

    }


}
admin()



// 拟态框
function _mimicry(){
    var filebtn=document.querySelector("#file")
    var lowpasswordbox=document.querySelector("#lowpasswordbox")
    var minicry=document.querySelector("#minicry")
    var ceragebtn=document.querySelector("#ceragebtn")
    lowpasswordbox.addEventListener("click",function(e){
       e.stopPropagation();
        
    })
    minicry.addEventListener("click",function(){
        this.style.display="none"
    })
    ceragebtn.addEventListener("click",function(){
      minicry.style.display="block"
    })

    filebtn.onchange=function(){
        var file = this.files;
    //   console.log(file[0].name);
        $("#img_box").append(`<img src="img/${file[0].name}">`)
        $("#img_box img").on("click",function(){
      
            $(this).remove()
        })
    }





}
// 
_mimicry()

